package com.ms.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ms.entity.Schedule;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ScheduleMapper extends BaseMapper<Schedule> {
    
    /**
     * 根据主办方ID查询所有赛程安排
     * @param organizerId 主办方ID
     * @return 赛程列表
     */
    @Select("SELECT s.* FROM schedule s " +
            "JOIN game g ON s.gameID = g.games_id " +
            "WHERE g.or_id = #{organizerId}")
    List<Schedule> selectSchedulesByOrganizerId(Integer organizerId);
}